﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using nERP.Model;

namespace nERP.Model.Rpt
{
    /// <summary>
    /// 仪表板
    /// </summary>
	[Table("Dashboard")]
    [SoftKey(nameof(Dashboard.Monthly))]
    [Display(Name = "_Model.Dashboard")]
    public class Dashboard : TopBasePoco, ITenant
    {
        [Display(Name = "_Model._Dashboard._PoAmount")]
        [Comment("采购总额")]
        public decimal? PoAmount { get; set; }
        [Display(Name = "_Model._Dashboard._PoAmounted")]
        [Comment("已签采购总额")]
        public decimal? PoAmounted { get; set; }
        [NotMapped] public double PoScale { get; set; } = 0;
        [Display(Name = "_Model._Dashboard._SoAmount")]
        [Comment("销售总额")]
        public decimal? SoAmount { get; set; }
        [Display(Name = "_Model._Dashboard._SoAmounted")]
        [Comment("已签销售总额")]
        public decimal? SoAmounted { get; set; }
        [NotMapped] public double SoScale { get; set; } = 0;
        [Display(Name = "_Model._Dashboard._PayAmount")]
        [Comment("付款总额")]
        public decimal? PayAmount { get; set; }
        [Display(Name = "_Model._Dashboard._PayAmounted")]
        [Comment("已签付款总额")]
        public decimal? PayAmounted { get; set; }
        [NotMapped] public double PayScale { get; set; } = 0;
        [Display(Name = "_Model._Dashboard._ReceivableAmount")]
        [Comment("收款总额")]
        public decimal? ReceivableAmount { get; set; }
        [Display(Name = "_Model._Dashboard._ReceivableAmounted")]
        [Comment("已签收款总额")]
        public decimal? ReceivableAmounted { get; set; }
        [NotMapped] public double ReceivableScale { get; set; } = 0;
        [Display(Name = "_Model._Dashboard._Monthly")]
        [StringLength(10, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("月份")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [CanNotEdit]
        public string Monthly { get; set; }
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

    }

}
